package cn.webrx;

import java.io.File;
import java.io.PrintWriter;
import java.util.UUID;

public class Dir7 {
    public static void main(String[] args) {
        //统计
        File file = new File("c:/javase2203/user");
        String[] fs = file.list((f, s) -> s.contains("1234"));
        for(String s : fs){
            System.out.println(s);
        }
    }

    public static void create(String[] args) {
        //建立目录
        String dir = "user";
        File file = new File(dir);
        if (!file.exists()) {
            file.mkdirs();
        }


        //建立100个记事本文件
        for (int i = 0; i < 10000; i++) {
            String u = UUID.randomUUID().toString().toLowerCase();
            try (var out = new PrintWriter("c:/javase2203/user/" + u + ".txt")) {
                out.println(u);
                out.println(u);
                out.println(u);
                out.flush();
                System.out.println();
            } catch (Exception e) {
            }
        }

    }
}
